package 作业;

import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;

public class 练习3 {
    public static void main(String[] args) {
        Set set=new HashSet();
        Set set1=new HashSet();
        while (true){
            int id=(int)(Math.random()*29)+1;
            int grade=(int)(Math.random()*6)+1;
            double score=(int)(Math.random()*101);
            if (!set1.contains(id)){
                lianxi xi=new lianxi(id,grade,score);
                set.add(xi);
                set1.add(id);
            }
            if (set.size()==20){
                break;
            }
        }
        Iterator it=set.iterator();
        while (it.hasNext()){
            lianxi xi=(lianxi)it.next();
            System.out.println(xi.id+"\t"+xi.grade+"\t"+xi.score);
        }
    }
}
